import { DomUtils } from "../utils/DomUtils";

export class CTO51 {

    static hostname = 'blog.51cto.com';

    main() {
        DomUtils.hide([
            '.home-top',
            '.Header',
            '.action-aside-left',
            '.detail-content-right',
            '.signIn',
            '.editArticle',
            '.feedback',
            '.live',
            '.hover-ball',
            '.fixtitle',
            '#comment',
            '.Footer'
        ], 'scale');
        DomUtils.observe(document.body, ['childList'], { childList: true }, ({ target }) => {
            const hoverBall = target.querySelector('.hover-ball');
            if (hoverBall) {
                hoverBall.remove();
            }
        });
        DomUtils.setCss('.minmenu > ul', { width: '50px', height: '50px', paddingTop: 0 });
        DomUtils.setCss('.detail-content-left', { width: '900px', margin: '0 auto', float: 'none' });
        DomUtils.setCss('#page_center', { width: '900px', margin: '0 auto' });
        DomUtils.setCss('.Content.detail-content-new', { padding: 0 });
        DomUtils.setCss('.Content-box', { width: '900px', margin: '20px auto', 
            borderRadius: '10px', overflow: 'hidden' });
        DomUtils.setCss('.article-detail', { padding: '20px', margin: 0 });
        DomUtils.setCss('.article-content-wrap', { margin: 0, padding: 0 });
        DomUtils.appendStyle(`
            .detail-content-new .Page .detail-content-left .common-spacing {
                padding: 20px;
                margin: 0;
            }
        `);

        DomUtils.setBackground();
    }
}